package com.zzzy.doc.dao.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 公文基本信息
 *
 * @author fc
 * @since 2024-08-09
 */
@Getter
@Setter
@TableName("document")
@Schema(description = "公文基本信息")
public class Document {

    @Schema(description = "ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "发文标题")
    @TableField("`subject`")
    private String subject;

    @Schema(description = "发文字号")
    @TableField("doc_no")
    private String docNo;

    @Schema(description = "紧急程度（1、2、3）")
    @TableField("urgency")
    private Integer urgency;

    @Schema(description = "紧急程度（普通、紧急、特级）")
    @TableField(exist = false)
    private String urgencyDescription;

    @Schema(description = "密级（公开、限阅、秘密、机密、绝密）")
    @TableField("secret_level")
    private String secretLevel;

    @Schema(description = "发文单位")
    @TableField("send_unit")
    private String sendUnit;

    @Schema(description = "发文单位意见")
    @TableField("send_unit_advice")
    private String sendUnitAdvice;

    @Schema(description = "主送单位ID拼接字符串：以英文逗号分隔")
    @TableField("main_send_unit_ids")
    private String mainSendUnitIds;

    @Schema(description = "抄送单位ID拼接字符串：以英文逗号分隔")
    @TableField("copy_send_unit_ids")
    private String copySendUnitIds;

    @Schema(description = "限办日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @TableField("end_date")
    private LocalDate endDate;

    @Schema(description = "印发日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @TableField("print_date")
    private LocalDate printDate;

    @Schema(description = "印发机关")
    @TableField("print_unit")
    private String printUnit;

    @Schema(description = "印发份数")
    @TableField("print_count")
    private Integer printCount;

    @Schema(description = "是否允许拷贝（是、否）")
    @TableField("is_allow_copy")
    private String isAllowCopy;

    @Schema(description = "是否添加水印（是、否）")
    @TableField("is_water_mark")
    private String isWaterMark;

    @Schema(description = "公文文本")
    @TableField("doc_text")
    private String docText;

    @Schema(description = "公文摘要")
    @TableField("doc_precis")
    private String docPrecis;

    @Schema(description = "缩略图 二进制流")
    @TableField("doc_thumbnail_blob")
    private byte[] docThumbnailBlob;

    @Schema(description = "发文状态：拟稿、审核修订、会签、领导签发 、清稿套红、 签章、 分发、办结、归档")
    @TableField("`status`")
    private String status;

    @Schema(description = "拟稿人ID")
    @TableField("user_id")
    private Long userId;

    @Schema(description = "拟稿人真实姓名")
    @TableField("user_name")
    private String userName;

    @Schema(description = "当前办理人ID")
    @TableField("operator_id")
    private Long operatorId;

    @Schema(description = "当前办理人姓名")
    @TableField("operator_name")
    private String operatorName;

    @Schema(description = "说明")
    @TableField("memo")
    private String memo;

    @Schema(description = "新建时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    private LocalDateTime createTime;

    @Schema(description = "修改时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("update_time")
    private LocalDateTime updateTime;
}
